// component/modal/modal.js
const app = getApp()
import wxRequest from "../../utils/http.js";
Component({
  behaviors: [],
  properties: {
    param:String
  },
  data: {
    // 显示隐藏
    modalShow: true,
    // 输入框值
    modalValue: '',
    link: ''
  },
  // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
  attached: function () {},
  moved: function () {},
  detached: function () {},
  methods: {
    // 确定
    modalConfirm() {
      console.log(this.data.modalValue);
      this.triggerEvent('changeModal',!this.data.modalShow)
      wxRequest(app.globalData.url + this.properties.param, {
        url:this.data.modalValue
      }).then(res=>{
        console.log(res,'ppp');
      })
      this.data.link="http://t.cn/R3eupoz"
    },
    // 取消
    modalCancel() {
      this.triggerEvent('changeModal', !this.data.modalShow)
    }
  }
})